<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    //匹配1-223
//    var reg=/[1-9]|[1-2][0-2][0-3]/;
   var reg= /^([1-9]|[1-9]\d|1\d\d|2[01]\d|22[0-3]])$/;
    var str;
    for(var i=1;i<=223;++i){
        str=""+i+"";
        if(!(str.match(reg))){
            console.log(i);
            break;
        }else{
            console.log(str.match(reg))
        }
    }
</script>
</body>
</html>